package com.githan.ksback_v2_3.Controller;

import com.alibaba.fastjson.JSON;
import com.githan.ksback_v2_3.Services.QuackResultsPingDingShanService;
import com.githan.ksback_v2_3.Services.QuackStationPingDingShanService;
import com.githan.ksback_v2_3.Entity.MineQuakeResultsPingDingShan;
import com.githan.ksback_v2_3.Entity.MineQuakeStationPingDingShan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author https://github.com/Han56
 * @date 2021/3/27 8:49
 * 描述：平顶山控制层
 */
@RestController
public class PingDingShanResultsController {
    @Autowired
    QuackResultsPingDingShanService quackResultsPingDingShanService;

    @Autowired
    QuackStationPingDingShanService quackStationPingDingShanService;

    @GetMapping("/pds_test")
    public String pds_test(){
        List<MineQuakeResultsPingDingShan> testList = quackResultsPingDingShanService.getAllPingDingShanResults();
        String return_json = JSON.toJSONString(testList);
        return return_json;
    }

    @GetMapping("/pds_station")
    public String pds_station(){
        List<MineQuakeStationPingDingShan> testList = quackStationPingDingShanService.getAllPingDingShanStation();
        String return_json = JSON.toJSONString(testList);
        return return_json;
    }
}
